package cn.tedu._06vehicle.pojo.dto;

import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.*;
import lombok.Data;

@Data
public class UserRegParam {
    @Schema(description = "用户姓名",required= true)
//    @NotNull(message = "用户姓名不能为空")
//    @NotEmpty(message = "用户姓名不能为空和空字符串")
//    @NotBlank(message = "用户姓名不能为空和空字符串和空白字符串")
//    @Size(min = 5,max = 10,message = "用户姓名长度必须在5-10之间")
    @Pattern(regexp = "^(?!(?:.*[\\u4e00-\\u9fa5]){8,})(?:[\\u4e00-\\u9fa5A-Za-z0-9_]){1,14}$",message = "用户名不能超过7个汉字或14个字符")
    private String username;
    @Schema(description = "密码",required= true)
    @Pattern(regexp = "^(?=.*\\d)(?=.*[a-zA-Z])(?=.*[!@#$%^&*()_+\\-=\\[\\]{};':\"\\\\|,.<>\\/?]).{8,20}$",message = "密码格式错误")
    private String password;
    @Schema(description = "邮箱",required= true)
//    @Email(message = "邮箱格式错误")
    @Pattern(regexp = "^[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\\.[A-Za-z]{2,}$",message = "邮箱格式错误")
    private String email;
    @Pattern(regexp = "^1[3-9]\\d{9}$",message = "手机号码格式错误")
    @Schema(description = "手机号码",required= true)
    private String phone;
}
